package com.weiwen.ww.adapter;

import java.util.List;

import com.weiwen.ww.R;
import com.weiwen.ww.domain.News;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;

public class NewsListViewAdapter extends BaseAdapter {
	private List<News> mNewsList;
	private Context mContext;
	public NewsListViewAdapter(Context context ,List<News> newsList){
		this.mNewsList = newsList;
		this.mContext = context;
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return mNewsList.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return mNewsList.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		View view = LayoutInflater.from(mContext).inflate(R.layout.news_item, null);
		return view;
	}

}
